How to fix undefined variable error in JavaScript

welcome to shbcf.ru